package com.company.memento;

/**
 * 发起者角色
 */
public class Originator {
    //持有游戏状态实例引用
    private GateStatus gateStatus;

    public GateStatus getGateStatus() {
        return gateStatus;
    }

    public void setGateStatus(GateStatus gateStatus) {
        this.gateStatus = gateStatus;
    }

    /**
     * 保存当前游戏状态(即存档)
     * @return
     */
    public Memento saveGateStatus(){
        return new Memento(gateStatus);
    }

    /**
     * 恢复游戏状态
     * @param Memento
     */
    public void recoverGateStatus(Memento Memento){
        gateStatus = Memento.getGateStatus();
    }
}
